package io.renren.modules.sys.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.sys.dao.DepotDao;
import io.renren.modules.sys.entity.DepotEntity;
import io.renren.modules.sys.service.DepotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("depotService")
public class DepotServiceImpl extends ServiceImpl<DepotDao, DepotEntity> implements DepotService {
    @Autowired
    private DepotDao dao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<DepotEntity> page = this.selectPage(
                new Query<DepotEntity>(params).getPage(),
                new EntityWrapper<DepotEntity>().eq("type",params.get("type"))
        );

        return new PageUtils(page);
    }

    @Override
    public List<DepotEntity> findDepotByMap(Map<String, Object> params) {
        return dao.findDepotByMap(params);
    }

}
